/*
 * @Author: your name
 * @Date: 2019-11-29 15:35:42
 * @LastEditTime: 2019-12-03 15:46:47
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \web\avue-cli\src\store\modules\equipmentLedger.js
 */
import {
  getEquipmentType
} from '@/api/equipment/device/management.js'
export default {
  namespaced: true,
  state: {
    equipmentType: null
  },
  getters: {},
  mutations: {
    //设备类型
    setEquipmentType(state, data) {
      state.equipmentType = data
    },

  },
  actions: {
    _getEquipmentType({ //设备类型
      commit
    }) {
      getEquipmentType().then(res => {
        if (res.data.code === 200) {
          commit('setEquipmentType', res.data.data)
        } else {
          this.$notify.error({
            title: '查询失败',
            message: '获取数据失败！',
            type: 'danger',
          });
        }
      })
    }

  }
}